<?php
/**
 * Model representing service version.
 * It uses mapper to store service versions data in database table.
 * 
 * @author Damian Sromek <damianpaq@gmail.com>
 * @version 0.1
 */
// TODO: comment
// TODO: add checking setters parameters
// TODO: getter: user, mail category
class Plus_Model_Mail_Mail extends Plus_Model_Model_DbTable_Abstract
{	
	protected $_idUser;
	protected $_title;
	protected $_text;
	protected $_dateSend;
	protected $_isVisibleSender;
	protected $_isVisibleReceiver;
	protected $_isRead;
	protected $_idMailCategory;
	
	/**
	 * Creates service version model.
	 * @param $options array with service version data
	 * @return void
	 */
	public function __construct(array $options = array())
	{
		$options['idName'] = '_id';
		parent::__construct($options, 'Plus_Model_Mail_Mapper');
		$this	->addVar('_id', 'id_mail', 'Id')
				->addVar('_idUser', 'id_user', 'IdUser')
				->addVar('_title', 'title', 'Title')
				->addVar('_text', 'text', 'Text')
				->addVar('_dateSend', 'date_send', 'DateSend')
				->addVar('_isVisibleSender', 'is_visible_sender', 'IsVisibleSender')
				->addVar('_isVisibleReceiver', 'is_visible_receiver', 'IsVisibleReceiver')
				->addVar('_isRead', 'is_read', 'IsRead')
				->addVar('_idMailCategory', 'id_mail_category', 'IdMailCategory');
	}
	
	public function setIdUser($value)
	{
		$this->_id_user = $value;	
		return $this;
	}
	
	public function getIdUser()
	{
		return $this->_id_user;
	}

	public function setTitle($value)
	{
		$this->_title = $value;	
		return $this;
	}
	
	public function getTitle()
	{
		return $this->_title;
	}
	

	public function setText($value)
	{
		$this->_text = $value;	
		return $this;
	}
	
	public function getText()
	{
		return $this->_text;
	}
	

	public function setDateSend($value)
	{
		$this->_dateSend = $value;	
		return $this;
	}
	
	public function getDateSend()
	{
		return $this->_dateSend;
	}
	

	public function setIsVisibleReader($value)
	{
		$this->_isVisibleReader = $value;	
		return $this;
	}
	
	public function getIsVisibleReader()
	{
		return $this->_isVisibleReader;
	}
	

	public function setIsVisibleReceiver($value)
	{
		$this->_isVisibleReceiver = $value;	
		return $this;
	}
	
	public function getIsVisibleReceiver()
	{
		return $this->_isVisibleReceiver;
	}
	

	public function setIsRead($value)
	{
		$this->_isRead = $value;	
		return $this;
	}
	
	public function getIsRead()
	{
		return $this->_isRead;
	}
	

	public function setIdMailCategory($value)
	{
		$this->_idMailCategory = $value;	
		return $this;
	}
	
	public function getIdMailCategory()
	{
		return $this->_idMailCategory;
	}
}